<?php
class GmDeleteUserCacheAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_STRING,
        SzAbstractAction::TYPE_STRING
    );
    /**
     *  删除缓存数据
     *
     * @param string $cacheColumnValue   缓存键值
     * @param string $token
     * @param string $cacheColumnName    缓存键对应的字段名
     * @throws SzException 20050
     * @return SzResponse $response
     */
    public function execute($cacheColumnValue, $token, $cacheColumnName = 'userId')
    {
        if ($token != GameConst::MAGIC_TOKEN) {
            throw new SzException(20050);
        }

        return $this->buildResponse(
            GmService::get()->deletePlayerCache($cacheColumnValue, $cacheColumnName)
        );
    }
}